package com.fooddiary.util;

import org.apache.commons.collections.Predicate;

import com.fooddiary.model.Weight;


/**
 * 
 * @author Created by andrey.kuznetsov <br>
 * @author Last modified by $Author$ <br>
 * @author Last modified on $Date$ at revision $Revision$ <br>
 */
public class WeightPredicate implements Predicate {

	private Long date;
	
	/**
	 * Constructor for {@link WeightPredicate}
	 * @param p_date - date for comparation
	 */
	public WeightPredicate(Long p_date) {
		super();
		date = p_date;
	}

	@Override
	public boolean evaluate(Object p_obj) {
		Weight weight = (Weight) p_obj;
		return weight.getDate().equals( date );
	}

}
